import axios from "axios";
const serive = axios.create({
    baseURL:"http://localhost:8080",
    timeout:10000
})
// 请求拦截
serive.interceptors.request.use(function(config){
    console.log(config);
    console.log(sessionStorage.getItem("token"));
    config.headers["Content-Type"] = "application/json";
    config.headers["Authorization"] = `Bearer ${sessionStorage.getItem("token")}`;
    return config;
},function(error){
    return Promise.reject(error);
})
// 响应拦截
serive.interceptors.response.use(function(response){
    return response;
},function(error){
    return Promise.reject(error);
})
export default serive;